// 制作仙露丸子 {"材料1":18,"材料2":17}
// @ts-ignore
export async function execute(client_id, message_json) {
    let characters = G.Characters.get_current_login_characters(client_id);
    let item_index_1 = message_json["材料1"] - 1;
    let item_index_2 = message_json["材料2"] - 1;
    // 神兽涎
    let item_1 = characters["道具"][item_index_1];
    // 仙露小丸子
    let item_2 = characters["道具"][item_index_2];
    // 校验材料数据
    if (!item_1 || !item_2 || item_1["名称"] !== "神兽涎" || item_2["名称"] !== "仙露小丸子" ) {
        ClientUtils.send_basic_prompt(client_id, "材料数据非法");
        return;
    }
    if (item_2["数量"] < 10) {
        ClientUtils.send_basic_prompt(client_id, "你的仙露小丸子不够10个");
        return;
    }
    if (characters["体力"] < 100) {
        ClientUtils.send_basic_prompt(client_id, "体力不足");
        return;
    }
    characters["体力"] -= 100;
    // 扣除材料
    G.Characters.remove_item(characters["id"], "道具", item_index_2, 10);
    G.Characters.remove_item(characters["id"], "道具", item_index_1, 1);
    // 随机给予仙露丸子
    G.Characters.add_item(characters["id"], "仙露丸子", G.RandomUtils.generate_random(2, 6));
    // 刷新道具
    G.Characters.refrush_item_data(characters["id"], ["道具"]);
    // 刷新体力活力
    ClientUtils.send_client_message(client_id, 15, { "体力": characters["体力"], "活力": characters["活力"] });
    // 刷新仙露丸子窗口
    let send_item_data = {
        "银子": characters["银子"],
        "储备": characters["储备"],
        "存银": characters["存银"],
        "道具": characters["道具"],
    };
    ClientUtils.send_client_message(client_id, 351, send_item_data);

}